Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

numeral

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

numeral

Format and manipulate numbers.

  • 1.5.6
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is numeral?

The numeral npm package is a library for formatting and manipulating numbers. It allows users to perform number formatting, including currency, percentages, and time; convert between different units; and manipulate numbers with mathematical operations.

What are numeral's main functionalities?

Number Formatting

This feature allows users to format numbers with commas as thousands separators, which is useful for displaying large numbers in a more readable format.

"const numeral = require('numeral');\nlet number = numeral(1000);\nlet formatted = number.format('0,0');\nconsole.log(formatted); // '1,000'"

Currency Formatting

Currency formatting feature enables users to format numbers as currency, including the addition of currency symbols and control over decimal places, making it easier to display monetary values.

"const numeral = require('numeral');\nlet money = numeral(1000.234);\nlet formatted = money.format('$0,0.00');\nconsole.log(formatted); // '$1,000.23'"

Percentage Formatting

This feature allows for the formatting of numbers as percentages, including rounding and specifying the number of decimal places, useful for displaying ratios or proportions.

"const numeral = require('numeral');\nlet percent = numeral(0.974878234);\nlet formatted = percent.format('0.00%');\nconsole.log(formatted); // '97.49%'"

Other packages similar to numeral

Keywords

FAQs

Package last updated on 24 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc